package com.pand.model.company;

import com.pand.model.BaseObject;
import com.pand.model.city.City;

import javax.persistence.*;

/**
 * 
 * @ClassName: Company
 * @Description: 企业信息
 *
 */
@Entity
@Table(name = "RES_COMPANY")
@SequenceGenerator(name = "SeqCompany", sequenceName = "SEQ_COMPANY")
public class Company extends BaseObject {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8883191858677842978L;

	/**
	 * 主键
	 */
	private Long id;

	/**
	 * 公司名称
	 */
	private String companyName;

	/**
	 * 行业
	 */
	private String trade;

	/**
	 * 所属城市
	 */
	private City city;

	/**
	 * 行业名称
	 */
	private String tradeName;

	@Transient
	public String getTradeName() {
		return tradeName;
	}

	public void setTradeName(String tradeName) {
		this.tradeName = tradeName;
	}

	private String companyCode;

	@Id
	@GeneratedValue(generator = "SeqCompany")
	@Column(name = "ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "COMPANY_NAME")
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "TRADE")
	public String getTrade() {
		return trade;
	}

	public void setTrade(String trade) {
		this.trade = trade;

	}

	@Column(name = "COMPANY_CODE")
	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
	@JoinColumn(name = "CITY_ID")
	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}

}
